﻿<controls:MetroWindow
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:chat="clr-namespace:BTM_Client_Application.Chat" mc:Ignorable="d" x:Class="BTM_Client_Application.MainWindow"
        Title="MainWindow" ResizeMode="CanResizeWithGrip" MinWidth="600" MinHeight="400" Initialized="MainWindow_OnInitialized" 
        d:DesignWidth="733.335" d:DesignHeight="478.222" Closing="MainWindow_OnClosing">

    <controls:MetroWindow.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colours.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Blue.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml" />
                <!--<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.AnimatedTabControl.xaml" />-->
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.AnimatedSingleRowTabControl.xaml" />
                <!--<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/FlatButton.xaml" />-->
                <ResourceDictionary Source="pack://application:,,,/Styles/ButtonStyles.xaml" />
                <ResourceDictionary Source="pack://application:,,,/Styles/MyResources.xaml" />
                <ResourceDictionary Source="pack://application:,,,/Styles/GridSplitter.xaml" />
                <ResourceDictionary Source="pack://application:,,,/Styles/TreeViewItem.xaml" />
                <ResourceDictionary Source="pack://application:,,,/Styles/ToolTip.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </controls:MetroWindow.Resources>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="30"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="76*"/>
            <RowDefinition Height="25"/>
        </Grid.RowDefinitions>
        <Menu Grid.Row="0" HorizontalAlignment="Stretch" VerticalAlignment="Center" Margin="0,2" BorderThickness="0,0,0,1" BorderBrush="{DynamicResource AccentColorBrush}">
            <MenuItem x:Name="MenuMenuItem" Header="Menu">
                <!--<MenuItem x:Name="RestartMenuItem" Header="Restart" Click="RestartMenuItem_OnClick"></MenuItem>-->
                <MenuItem x:Name="EditMenuItem" Header="Edit Markers" Click="EditMenuItem_OnClick"/>
                <MenuItem x:Name="ExitMenuItem" Click="ExitMenuItem_OnClick" Header="Exit"/>
            </MenuItem>
            <MenuItem x:Name="OptionsMenuItem" Header="Options" Click="OptionsMenuItem_OnClick"></MenuItem>
            <MenuItem x:Name="AboutMenuItem" Header="About" Click="AboutMenuItem_OnClick"></MenuItem>
        </Menu>
        <!-- Панель инструментов -->
        <Border Name="ToolsBorder" Grid.Row="1" BorderThickness="0,0,0,1" BorderBrush="Gray" HorizontalAlignment="Stretch" VerticalAlignment="Center" Visibility="Collapsed">
            <ToolBarTray VerticalAlignment="Center" HorizontalAlignment="Stretch" Background="{DynamicResource AccentColorBrush}">
                <ToolBar ToolBarTray.IsLocked="True" VerticalAlignment="Center" HorizontalAlignment="Stretch">
                    <StackPanel VerticalAlignment="Center">
                        <Button Name="MapButton" Height="30" Foreground="White" Style="{StaticResource ToolBarButton}" Click="MapButton_OnClick">
                            <Image Source="{StaticResource MapGpsDark}" Stretch="Uniform">
                            </Image>
                        </Button>
                        <TextBlock Name="MapLabel" Foreground="White" HorizontalAlignment="Center">Map</TextBlock>
                    </StackPanel>
                    <StackPanel VerticalAlignment="Center">
                        <Button Name="FilterButton" Height="30" Style="{StaticResource ToolBarButton}" Click="FilterButton_OnClick">
                            <Image Source="{StaticResource FilterDark}" Stretch="Uniform">
                            </Image>
                        </Button>
                        <TextBlock Name="FilterLabel" Foreground="White" HorizontalAlignment="Center">Filter</TextBlock>
                    </StackPanel>
                    <StackPanel VerticalAlignment="Center">
                        <Button Name="LogButton" Height="30" Style="{StaticResource ToolBarButton}" Click="LogButton_OnClick">
                            <Image Source="{StaticResource DatabaseDark}" Stretch="Uniform">
                            </Image>
                        </Button>
                        <TextBlock Name="LogLabel" Foreground="White" HorizontalAlignment="Center">Log</TextBlock>
                    </StackPanel>
                    <StackPanel VerticalAlignment="Center">
                        <Button Name="ChatButton" Height="30" Style="{StaticResource ToolBarButton}" Click="ChatButton_OnClick">
                            <Image Source="{StaticResource ChatDark}" Stretch="Uniform">
                            </Image>
                        </Button>
                        <TextBlock Name="ChatLabel" Foreground="White" HorizontalAlignment="Center">Chat</TextBlock>
                    </StackPanel>
                </ToolBar>
            </ToolBarTray>
        </Border>
        
        <Grid HorizontalAlignment="Stretch" Grid.Row="2" VerticalAlignment="Stretch">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="10*" MinWidth="100"/>
                <ColumnDefinition Width="10"/>
                <ColumnDefinition Width="40*" MinWidth="400"/>
                <ColumnDefinition Name="InfoRow" Width="Auto"/>
            </Grid.ColumnDefinitions>
            <TreeView Name="DeviceTreeView" Grid.Column="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" 
                      ItemContainerStyle="{StaticResource TreeViewItemStyle}" MouseDoubleClick="DeviceTreeView_OnMouseDoubleClick"/>
            <GridSplitter Style="{StaticResource GridSplitterStyle}" ResizeDirection="Columns" Grid.Column="1" HorizontalAlignment="Left,Center,Right"/>
            <TabControl Grid.Column="2" Margin="0,1,0,1" Name="TabsContainer">
                <TabItem Header="Map" Name="MapTab">
                    <Grid Name="MapContent"/>
                </TabItem>
                <TabItem Header="List" Name="ErrorListTab">
                    <Grid Name="ListContent"/>
                </TabItem>
                <TabItem Header="Chat" Name="ChatTab">
                    <Border BorderThickness="1" BorderBrush="Gray" SnapsToDevicePixels="True">
                        <Grid Name="ChatContent"/>
                    </Border>
                </TabItem>
            </TabControl>
            <!--MiniButton-->
            <Button Name="ShowInfoButton" Visibility="Hidden" Style="{StaticResource StandardButton}" Margin="0,80,0,0" Width="20" Height="30"  VerticalAlignment="Center" HorizontalAlignment="Right" Grid.Column="2" Click="ShowInfoButton_OnClick">
                <Image Source="{StaticResource NavigatePreviousImageDark}" Stretch="Uniform"/>
            </Button>
            <Grid Name="ClientEventsContainer" Grid.Column="3"/>
            
        </Grid>
        <StatusBar HorizontalAlignment="Stretch" Grid.Row="3" VerticalAlignment="Stretch" Background="{DynamicResource AccentColorBrush}">
            <StatusBarItem HorizontalContentAlignment="Stretch" VerticalContentAlignment="Center">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Name="StatusBox" Text="Status" Foreground="White" Margin="0,0,20,0"/>
                        <TextBlock Name="RecordsCountLabel" Text="Records Count:" Foreground="White" Margin="0,0,5,0"/>
                        <TextBlock Name="RecordsCountBox" Text="0" Foreground="White" Margin="0,0,20,0"/>
                        <TextBlock Name="UnreadRecordsCountLabel" Text="UnreadRecords:" Foreground="White" Margin="0,0,5,0"/>
                        <TextBlock Name="UnreadRecordsCountBox" Text="0" Foreground="White"/>
                    </StackPanel>
                </Grid>
            </StatusBarItem>
        </StatusBar>
    </Grid>
</controls:MetroWindow>
